/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: regexDemo
 * Author:   666
 * Date:     2022/1/16 18:36
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.regex;

/**
 * @Classname regexDemo
 * @Description TODO
 * @Date 2022/1/16 18:36
 * @Created by 666
 */
public class regexDemo {
    public static void main(String[] args) {
        checkPhone();

    }

    public  static  void checkPhone(){
        String phone = "18293039306";
        String tel = "0911321-46241694624169462416";
        String regexStr = "^1[3-9]\\d{9}$";
        String telRegexStr = "^0\\d{2,6}-?\\d{5,20}$";
        if (tel.matches(telRegexStr)) {
            System.out.println("是手机号");
        }else{
            System.out.println("不是手机号");
        }
    }
}
